import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import VueLazyLoad from 'vue-lazyload'
import infiniteScroll from 'vue-infinite-scroll'
import axios from 'axios'
import store from './store/index.js'
import {
  currency
} from './util/currency.js'
import VueCookies from 'vue-cookies'

Vue.use(VueCookies)
//价格格式化
Vue.filter("currency", currency)
//导入字体图标库
import './assets/fonts/iconfont.css'

//导入样式
import './assets/css/base.css'
import './assets/css/checkout.css'
import './assets/css/product.css'
Vue.config.productionTip = false

Vue.use(infiniteScroll)

Vue.use(VueLazyLoad, {
  loading: '../static/loading-svg/loading-bars.svg',
  try: 3 // default 1
})

Vue.prototype.$axios = axios
//配置请求基础路径
axios.defaults.baseURL = "http://localhost:3000"
//拦截响应
axios.interceptors.response.use(res => res.data)

new Vue({
  store,
  router,
  render: h => h(App)
}).$mount('#app')
